package com.xxxx.seckill.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * RabbitMQ配置类-fanout模式
 *
 * @author FYM
 * @data 2022/3/23 16:12
 */
/*
@Configuration
public class RabbitMQFanoutConfig {
    private static final String QUEUE01 = "queue_fanout01";
    private static final String QUEUE02 = "queue_fanout02";
    private static final String EXCHANGE = "fanoutExchange";

    @Bean
    public Queue queue() {
        return new Queue("queueQ", true);
    }

    @Bean
    public Queue queue01() {
        return new Queue(QUEUE01, true);
    }

    @Bean
    public Queue queue02() {
        return new Queue(QUEUE02, true);
    }


    */
/**
     * fanoutExchange交换机(广播)
     *
     * @return
     *//*

    @Bean
    public FanoutExchange fanoutExchange() {
        return new FanoutExchange(EXCHANGE);
    }

    */
/**
     * 将queue01绑定到交换机上
     *
     * @return
     *//*

    @Bean
    public Binding binding01() {
        return BindingBuilder.bind(queue01()).to(fanoutExchange());
    }

    */
/**
     * 将queue02绑定到交换机上
     *
     * @return
     *//*

    @Bean
    public Binding binding02() {
        return BindingBuilder.bind(queue02()).to(fanoutExchange());
    }


}
*/
